package com.ruoyi.order.api.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import com.ruoyi.common.core.web.domain.BaseEntity;

import com.ruoyi.service.api.domain.CheService;
import com.ruoyi.shop.api.domain.CheCoupon;
import com.ruoyi.shop.api.domain.CheShop;
import com.ruoyi.system.api.domain.CheUserr;
import com.ruoyi.user.api.domain.CheCar;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * 订单对象 che_order
 * 
 * @author yun
 * @date 2024-12-31
 */
@Data
public class Order extends BaseEntity
{
    private static final long serialVersionUID = 1L;


    /** 订单编号 */
    private Long id;

    /** 订单号 */
    @Excel(name = "订单号")
    private String number;

    /** 门店id */
    @Excel(name = "门店id")
    private Long shopId;
    private CheShop shop;

    /** 车辆id */
    @Excel(name = "车辆id")
    private Long carId;
    private CheCar car;


    /** 用户id */
    @Excel(name = "用户id")
    private Long userId;
    private CheUserr user;

    /** 服务类别id */
    @Excel(name = "服务类别id")
    private Long serviceId;

    /** 优惠卷id */
    @Excel(name = "优惠卷id")
    private Long couponId;
    private CheCoupon coupon;

    /** 总价 */
    @Excel(name = "总价")
    private Double totalPrice;

    /** 实付价格 */
    @Excel(name = "实付价格")
    private Double realPrice;

    /** 核销码 */
    @Excel(name = "核销码")
    private String verificationCode;

    /** 核销时间 */
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    private Date verificationTime;

    /** 预约时间 */
    @JsonFormat(pattern = "yyyy-MM-dd hh:mm:ss")
    @Excel(name = "预约时间", width = 30, dateFormat = "yyyy-MM-dd hh:mm:ss")
    private Date subscribeTime;

    /** 状态 */
    @Excel(name = "状态")
    private Long state;

    private List<CheService> serviceList;
    private List<Long> serviceIds;
    private Boolean isServiceChanged = false;

    private Boolean hasShop = true;
    private Boolean hasCar = true;
    private Boolean hasUser = true;
    private Boolean hasService = true;
    private Boolean hasCoupon = true;

    public void noneAll(){
        this.hasShop = false;
        this.hasCar = false;
        this.hasUser = false;
        this.hasService = false;
        this.hasCoupon = false;
    }


}
